package com.gy.paidao.util;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者：gy on 16/4/25
 * 说明：
 */
public class MarkerBitmapUpdataManager {

    private static MarkerBitmapUpdataManager instance;
    public List<MarkerBitmapUpdataListener> list;

    public static MarkerBitmapUpdataManager getInstance(){
        if(instance == null){
            instance = new MarkerBitmapUpdataManager();
        }
        return instance;
    }

    private MarkerBitmapUpdataManager(){
        list = new ArrayList<>();
    }

    public void addListener(MarkerBitmapUpdataListener listener){
        list.add(listener);
    }

    public void notifyListener(int id){
        for(MarkerBitmapUpdataListener listener : list){
            listener.markerUpdate(id);
        }
    }


    public interface  MarkerBitmapUpdataListener{
        void markerUpdate(int id);
    }
}
